module.exports = {
  runtimeCompiler: true,
  configureWebpack: (config) => {
    config.module.rules.push({
      test: /\.worker.js$/,
      use: {
        loader: 'worker-loader',
        options: { inline: true, name: 'workerName.[hash].js' }
      }
    })
    if (process.env.NODE_ENV === 'production') {
      // 为生产环境修改配置...
    } else {
      // 为开发环境修改配置...
    }
  },
  parallel: false,
  chainWebpack: (config) => {   
    
    config.output.globalObject("this");
    
    config.module
    .rule('js')   
    .exclude
    .add(/\.worker\.js$/)  
        
  },
  publicPath: "./",
  outputDir: "./lib",
  assetsDir: "",
  css: {
    modules: false,
    sourceMap: true,
  },
  devServer: {
    port: 8081,
  },
};
